<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","images":"/images","scheme":"Muse","version":"8.3.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}};
  </script>
<meta name="description" content="HTML标准格式&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head lang&#x3D;&quot;en&quot;&gt;	&lt;meta charset&#x3D;&quot;UTF-8&quot;&gt;	&lt;title&gt;&lt;&#x2F;title&gt;&lt;&#x2F;head&gt;&lt;body&gt;&lt;&#x2F;body&gt;&lt;&#x2F;html&gt; 标题&lt;bo">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML基础">
<meta property="og:url" content="http://example.com/2021/01/28/HTML/index.html">
<meta property="og:site_name" content="Lawted&#39;s Blog">
<meta property="og:description" content="HTML标准格式&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head lang&#x3D;&quot;en&quot;&gt;	&lt;meta charset&#x3D;&quot;UTF-8&quot;&gt;	&lt;title&gt;&lt;&#x2F;title&gt;&lt;&#x2F;head&gt;&lt;body&gt;&lt;&#x2F;body&gt;&lt;&#x2F;html&gt; 标题&lt;bo">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2021-01-28T03:23:46.000Z">
<meta property="article:modified_time" content="2021-01-28T03:25:10.067Z">
<meta property="article:author" content="Lawted Wu">
<meta property="article:tag" content="技术">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2021/01/28/HTML/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>
<title>HTML基础 | Lawted's Blog</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Lawted's Blog</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a></li>
        <li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML%E6%A0%87%E5%87%86%E6%A0%BC%E5%BC%8F"><span class="nav-number">1.</span> <span class="nav-text">HTML标准格式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A0%87%E9%A2%98"><span class="nav-number">1.1.</span> <span class="nav-text">标题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%B9%E9%BD%90"><span class="nav-number">1.2.</span> <span class="nav-text">对齐</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%AE%B5%E8%90%BD"><span class="nav-number">1.3.</span> <span class="nav-text">段落</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E7%9A%84%E6%A0%BC%E5%BC%8F%E5%8C%96%E6%A0%87%E7%AD%BE"><span class="nav-number">1.4.</span> <span class="nav-text">HTML的格式化标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E6%A0%B7%E5%BC%8F"><span class="nav-number">1.5.</span> <span class="nav-text">HTML样式</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A4%96%E9%83%A8%E6%A0%B7%E5%BC%8F%E8%A1%A8"><span class="nav-number">1.5.1.</span> <span class="nav-text">外部样式表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%86%85%E9%83%A8%E6%A0%B7%E5%BC%8F%E8%A1%A8"><span class="nav-number">1.5.2.</span> <span class="nav-text">内部样式表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%86%85%E8%81%94%E6%A0%B7%E5%BC%8F%E8%A1%A8"><span class="nav-number">1.5.3.</span> <span class="nav-text">内联样式表</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E9%93%BE%E6%8E%A5"><span class="nav-number">1.6.</span> <span class="nav-text">HTML链接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E8%A1%A8%E6%A0%BC"><span class="nav-number">1.7.</span> <span class="nav-text">HTML表格</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E5%88%97%E8%A1%A8"><span class="nav-number">1.8.</span> <span class="nav-text">HTML列表</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8"><span class="nav-number">1.8.1.</span> <span class="nav-text">无序列表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8"><span class="nav-number">1.8.2.</span> <span class="nav-text">有序列表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%B5%8C%E5%A5%97%E5%88%97%E8%A1%A8"><span class="nav-number">1.8.3.</span> <span class="nav-text">嵌套列表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%97%E8%A1%A8"><span class="nav-number">1.8.4.</span> <span class="nav-text">自定义列表</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E5%9D%97"><span class="nav-number">1.9.</span> <span class="nav-text">HTML块</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML%E5%9D%97%E5%85%83%E7%B4%A0"><span class="nav-number">1.9.1.</span> <span class="nav-text">HTML块元素</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML%E5%86%85%E8%81%94%E5%85%83%E7%B4%A0"><span class="nav-number">1.9.2.</span> <span class="nav-text">HTML内联元素</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-lt-div-gt-%E5%85%83%E7%B4%A0"><span class="nav-number">1.9.3.</span> <span class="nav-text">HTML&lt;div&gt;元素</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-lt-span-gt-%E5%85%83%E7%B4%A0"><span class="nav-number">1.9.4.</span> <span class="nav-text">HTML&lt;span&gt;元素</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E5%B8%83%E5%B1%80"><span class="nav-number">1.10.</span> <span class="nav-text">HTML布局</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%BD%BF%E7%94%A8-lt-div-gt-%E5%85%83%E7%B4%A0%E5%B8%83%E5%B1%80"><span class="nav-number">1.10.1.</span> <span class="nav-text">使用&lt;div&gt;元素布局</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%BD%BF%E7%94%A8-lt-table-gt-%E5%85%83%E7%B4%A0%E5%B8%83%E5%B1%80"><span class="nav-number">1.10.2.</span> <span class="nav-text">使用&lt;table&gt;元素布局</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E8%A1%A8%E5%8D%95"><span class="nav-number">1.11.</span> <span class="nav-text">HTML表单</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A4%8D%E9%80%89%E6%A1%86-checkbox"><span class="nav-number">1.11.1.</span> <span class="nav-text">复选框(checkbox)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%8D%95%E9%80%89%E6%8C%89%E9%92%AE-radio"><span class="nav-number">1.11.2.</span> <span class="nav-text">单选按钮(radio)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%B8%8B%E6%8B%89%E5%88%97%E8%A1%A8-select"><span class="nav-number">1.11.3.</span> <span class="nav-text">下拉列表(select)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E5%9F%9F-textarea"><span class="nav-number">1.11.4.</span> <span class="nav-text">文本域(textarea)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%8C%89%E9%92%AE-botton"><span class="nav-number">1.11.5.</span> <span class="nav-text">按钮(botton)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#PHP%E5%92%8C%E8%A1%A8%E5%8D%95%E7%9A%84%E4%BA%A4%E4%BA%92"><span class="nav-number">1.11.6.</span> <span class="nav-text">PHP和表单的交互</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML5%E6%A1%86%E6%9E%B6"><span class="nav-number">1.12.</span> <span class="nav-text">HTML5框架</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A1%86%E6%9E%B6%E6%A0%87%E7%AD%BEframe"><span class="nav-number">1.12.1.</span> <span class="nav-text">框架标签frame</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#target"><span class="nav-number">1.13.</span> <span class="nav-text">target</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E8%83%8C%E6%99%AF"><span class="nav-number">1.14.</span> <span class="nav-text">HTML背景</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HTML%E7%9A%84%E5%AE%9E%E4%BD%93"><span class="nav-number">1.15.</span> <span class="nav-text">HTML的实体</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#XHTML"><span class="nav-number">1.16.</span> <span class="nav-text">XHTML</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#contenteditable%E5%B1%9E%E6%80%A7"><span class="nav-number">1.17.</span> <span class="nav-text">contenteditable属性</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link"><span class="nav-number">2.</span> <span class="nav-text">可编辑列表</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#hidden%E5%B1%9E%E6%80%A7"><span class="nav-number">2.1.</span> <span class="nav-text">hidden属性</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link"><span class="nav-number">3.</span> <span class="nav-text">可编辑列表</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#spellcheck%E5%B1%9E%E6%80%A7"><span class="nav-number">3.1.</span> <span class="nav-text">spellcheck属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#tabindex%E5%B1%9E%E6%80%A7"><span class="nav-number">3.2.</span> <span class="nav-text">tabindex属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#article%E5%85%83%E7%B4%A0"><span class="nav-number">3.3.</span> <span class="nav-text">article元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#section%E5%85%83%E7%B4%A0"><span class="nav-number">3.4.</span> <span class="nav-text">section元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#nav%E5%85%83%E7%B4%A0"><span class="nav-number">3.5.</span> <span class="nav-text">nav元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#aside%E5%85%83%E7%B4%A0"><span class="nav-number">3.6.</span> <span class="nav-text">aside元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#time%E5%85%83%E7%B4%A0%E5%92%8C%E5%BE%AE%E6%A0%BC%E5%BC%8F"><span class="nav-number">3.7.</span> <span class="nav-text">time元素和微格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#pubdate%E5%B1%9E%E6%80%A7"><span class="nav-number">3.8.</span> <span class="nav-text">pubdate属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#header%E5%85%83%E7%B4%A0"><span class="nav-number">3.9.</span> <span class="nav-text">header元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#footer%E5%85%83%E7%B4%A0"><span class="nav-number">3.10.</span> <span class="nav-text">footer元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hgroup%E5%85%83%E7%B4%A0"><span class="nav-number">3.11.</span> <span class="nav-text">hgroup元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#address%E5%85%83%E7%B4%A0"><span class="nav-number">3.12.</span> <span class="nav-text">address元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BD%91%E9%A1%B5%E7%BC%96%E6%8E%92%E8%A7%84%E5%88%99"><span class="nav-number">3.13.</span> <span class="nav-text">网页编排规则</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84form%E5%B1%9E%E6%80%A7"><span class="nav-number">3.14.</span> <span class="nav-text">表单内元素的form属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84formaction%E5%B1%9E%E6%80%A7"><span class="nav-number">3.15.</span> <span class="nav-text">表单内元素的formaction属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84formmethod%E5%B1%9E%E6%80%A7"><span class="nav-number">3.16.</span> <span class="nav-text">表单内元素的formmethod属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84formenctype%E5%B1%9E%E6%80%A7"><span class="nav-number">3.17.</span> <span class="nav-text">表单内元素的formenctype属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84formtarget%E5%B1%9E%E6%80%A7"><span class="nav-number">3.18.</span> <span class="nav-text">表单内元素的formtarget属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#autofocus"><span class="nav-number">3.19.</span> <span class="nav-text">autofocus</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84required%E5%B1%9E%E6%80%A7"><span class="nav-number">3.20.</span> <span class="nav-text">表单内元素的required属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E5%86%85%E5%85%83%E7%B4%A0%E7%9A%84labels%E5%B1%9E%E6%80%A7"><span class="nav-number">3.21.</span> <span class="nav-text">表单内元素的labels属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A0%87%E7%AD%BE%E7%9A%84control%E5%B1%9E%E6%80%A7"><span class="nav-number">3.22.</span> <span class="nav-text">标签的control属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E6%A1%86%E7%9A%84placeholder%E5%B1%9E%E6%80%A7"><span class="nav-number">3.23.</span> <span class="nav-text">文本框的placeholder属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E6%A1%86%E7%9A%84list%E5%B1%9E%E6%80%A7"><span class="nav-number">3.24.</span> <span class="nav-text">文本框的list属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E6%A1%86%E7%9A%84autocomplete%E5%B1%9E%E6%80%A7"><span class="nav-number">3.25.</span> <span class="nav-text">文本框的autocomplete属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E6%A1%86%E7%9A%84pattern%E5%B1%9E%E6%80%A7"><span class="nav-number">3.26.</span> <span class="nav-text">文本框的pattern属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E6%A1%86%E7%9A%84SelectionDirection%E5%B1%9E%E6%80%A7"><span class="nav-number">3.27.</span> <span class="nav-text">文本框的SelectionDirection属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A4%8D%E9%80%89%E6%A1%86%E7%9A%84indeterminate%E5%B1%9E%E6%80%A7"><span class="nav-number">3.28.</span> <span class="nav-text">复选框的indeterminate属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#image%E6%8F%90%E4%BA%A4%E6%8C%89%E9%92%AE%E7%9A%84height%E5%B1%9E%E6%80%A7%E5%92%8Cwidth%E5%B1%9E%E6%80%A7"><span class="nav-number">3.29.</span> <span class="nav-text">image提交按钮的height属性和width属性</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Lawted Wu</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">67</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/LAWTED" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;LAWTED" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>



        </div>
      </div>
        <div class="back-to-top animated" role="button" aria-label="Back to top">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/01/28/HTML/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Lawted Wu">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Lawted's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          HTML基础
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>
      

      <time title="Created: 2021-01-28 11:23:46 / Modified: 11:25:10" itemprop="dateCreated datePublished" datetime="2021-01-28T11:23:46+08:00">2021-01-28</time>
    </span>

  
    <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">Views: </span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h2 id="HTML标准格式"><a href="#HTML标准格式" class="headerlink" title="HTML标准格式"></a>HTML标准格式</h2><figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="meta">&lt;!DOCTYPE <span class="meta-keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">head</span> <span class="attr">lang</span>=<span class="string">&quot;en&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">title</span>&gt;</span><span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h3 id="标题"><a href="#标题" class="headerlink" title="标题"></a>标题</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;h1&gt;标题1&lt;&#x2F;h1&gt;</span><br><span class="line">	&lt;h2&gt;标题2&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;h3&gt;标题3&lt;&#x2F;h3&gt;</span><br><span class="line">	&lt;h4&gt;标题4&lt;&#x2F;h4&gt;</span><br><span class="line">	&lt;h5&gt;标题5&lt;&#x2F;h5&gt;</span><br><span class="line">	&lt;h6&gt;标题6&lt;&#x2F;h6&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="对齐"><a href="#对齐" class="headerlink" title="对齐"></a>对齐</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">&lt;meta charset&#x3D;&quot;utf-8&quot;&gt;</span><br><span class="line">&lt;title&gt;对齐方式&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;h1&gt;这是一级标题&lt;&#x2F;h1&gt;</span><br><span class="line">&lt;h2 align&#x3D;&quot;left&quot;&gt;这是二级标题&lt;&#x2F;h2&gt;</span><br><span class="line">&lt;h3 align&#x3D;&quot;center&quot;&gt;这是三级标题&lt;&#x2F;h3&gt;</span><br><span class="line">&lt;h4 align&#x3D;&quot;right&quot;&gt;这是四级标题&lt;&#x2F;h4&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;</span><br></pre></td></tr></table></figure>
<h3 id="段落"><a href="#段落" class="headerlink" title="段落"></a>段落</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!doctype html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">&lt;meta charset&#x3D;&quot;utf-8&quot;&gt;</span><br><span class="line">&lt;title&gt;段落标签&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;p align&#x3D;&quot;right&quot;&gt;hello world&lt;&#x2F;p&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;</span><br></pre></td></tr></table></figure>
<p><strong>段落会空一行！</strong></p>
<h3 id="HTML的格式化标签"><a href="#HTML的格式化标签" class="headerlink" title="HTML的格式化标签"></a>HTML的格式化标签</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;b&gt;        定义粗体文本</span><br><span class="line">&lt;big&gt;      定义大号字（不使用）</span><br><span class="line">&lt;em&gt;       定义着重文字</span><br><span class="line">&lt;i&gt;        定义斜体字</span><br><span class="line">&lt;small&gt;    定义小号字</span><br><span class="line">&lt;strong&gt;   定义加重语气</span><br><span class="line">&lt;sub&gt;      定义下标字</span><br><span class="line">&lt;sup&gt;      定义上标字</span><br><span class="line">&lt;ins&gt;      定义插入字</span><br><span class="line">&lt;del&gt;      定义删除字</span><br></pre></td></tr></table></figure>
<h3 id="HTML样式"><a href="#HTML样式" class="headerlink" title="HTML样式"></a>HTML样式</h3><h4 id="外部样式表"><a href="#外部样式表" class="headerlink" title="外部样式表"></a>外部样式表</h4><figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/css&quot;</span> <span class="attr">href</span>=<span class="string">&quot;mystyle.css&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p>外部样式表写到head中</p>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-tag">h1</span>&#123;</span><br><span class="line">	<span class="attribute">color</span>:red;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="内部样式表"><a href="#内部样式表" class="headerlink" title="内部样式表"></a>内部样式表</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;style type&#x3D;&quot;text&#x2F;csss&quot;&gt;</span><br><span class="line">body&#123;background-color:red&#125;</span><br><span class="line">	p&#123;</span><br><span class="line">		margin-left:20px</span><br><span class="line">	&#125;</span><br><span class="line">&lt;&#x2F;style&gt;</span><br></pre></td></tr></table></figure>

<h4 id="内联样式表"><a href="#内联样式表" class="headerlink" title="内联样式表"></a>内联样式表</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;p style&#x3D;&quot;color:red&quot;&gt;你好&lt;&#x2F;p&gt;</span><br></pre></td></tr></table></figure>

<h3 id="HTML链接"><a href="#HTML链接" class="headerlink" title="HTML链接"></a>HTML链接</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;a href&#x3D;&quot;http:&#x2F;&#x2F;www.baidu.com&quot;&gt;点击我&lt;&#x2F;a&gt;</span><br><span class="line"></span><br><span class="line">&lt;a href&#x3D;&quot;http:&#x2F;&#x2F;www.baidu.com&quot;&gt;</span><br><span class="line">	&lt;img src:&quot;xxx.png&quot; width&#x3D;&quot;100px&quot; height&#x3D;&quot;100px&quot; alt&#x3D;&quot;这是一个html的&quot;&gt;</span><br><span class="line">&lt;&#x2F;a&gt; </span><br><span class="line"></span><br><span class="line">&lt;a name&#x3D;&quot;tips&quot;&gt;hello&lt;&#x2F;a&gt;</span><br><span class="line">&lt;br&#x2F;&gt;</span><br><span class="line">&lt;a href&#x3D;&quot;#tips&quot;&gt;跳转到hello&lt;&#x2F;a&gt;</span><br></pre></td></tr></table></figure>
<ul>
<li>href属性：指向另一个文档的链接</li>
<li>name属性:创建文档内的链接</li>
</ul>
<p>img标签属性</p>
<ul>
<li>alt：替换文本属性</li>
<li>width：宽</li>
<li>height：高</li>
</ul>
<h3 id="HTML表格"><a href="#HTML表格" class="headerlink" title="HTML表格"></a>HTML表格</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;table&gt;     定义表格</span><br><span class="line">&lt;caption&gt;   定义表格标题</span><br><span class="line">&lt;th&gt;        定义表格的表头</span><br><span class="line">&lt;tr&gt;        定义表格的行</span><br><span class="line">&lt;td&gt;        定义表格的单元</span><br><span class="line">&lt;thead&gt;     定义表格的页眉</span><br><span class="line">&lt;tbody&gt;     定义表格的主体</span><br><span class="line">&lt;tfoot&gt;     定义表格的页脚</span><br><span class="line">&lt;col&gt;       定义表格的列属性</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;table border&#x3D;&quot;10&quot; cellpadding&#x3D;&quot;100&quot;&gt;</span><br><span class="line">		&lt;caption&gt; test表格 &lt;&#x2F;caption&gt;</span><br><span class="line">		&lt;tr&gt;</span><br><span class="line">			&lt;th&gt;单元&lt;&#x2F;th&gt;</span><br><span class="line">			&lt;th&gt;	单元&lt;&#x2F;th&gt;</span><br><span class="line">			&lt;th&gt;单元&lt;&#x2F;th&gt;</span><br><span class="line">		&lt;&#x2F;tr&gt;</span><br><span class="line">		&lt;tr&gt;</span><br><span class="line">			&lt;td&gt;单元格1&lt;&#x2F;td&gt;</span><br><span class="line">			&lt;td&gt;单元格2&lt;&#x2F;td&gt;</span><br><span class="line">			&lt;td&gt;单元格3&lt;&#x2F;td&gt;</span><br><span class="line">		&lt;&#x2F;tr&gt;</span><br><span class="line">		&lt;tr&gt;</span><br><span class="line">			&lt;td&gt;单元格1&lt;&#x2F;td&gt;</span><br><span class="line">			&lt;td&gt;单元格2&lt;&#x2F;td&gt;</span><br><span class="line">			&lt;td&gt;单元格3&lt;&#x2F;td&gt;</span><br><span class="line">		&lt;&#x2F;tr&gt;</span><br><span class="line">	&lt;table&gt;</span><br><span class="line">&lt;body&gt;</span><br></pre></td></tr></table></figure>
<ul>
<li>border边框写在table中</li>
<li>cellpadding单元格大小写在table中</li>
<li>bgcolor背景颜色写在table中</li>
<li>background背景图片写在table中</li>
</ul>
<h3 id="HTML列表"><a href="#HTML列表" class="headerlink" title="HTML列表"></a>HTML列表</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;ol&gt;      有序列表</span><br><span class="line">&lt;ul&gt;      无序列表</span><br><span class="line">&lt;li&gt;      列表项</span><br><span class="line">&lt;dl&gt;      列表</span><br><span class="line">&lt;dt&gt;      列表项</span><br><span class="line">&lt;dd&gt;      描述</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;ul&gt;</span><br><span class="line">		&lt;li&gt;苹果&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;西瓜&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;梨子&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;&#x2F;ul&gt;</span><br><span class="line">	&lt;ol&gt;</span><br><span class="line">		&lt;li&gt;苹果&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;西瓜&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;梨子&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;&#x2F;ul&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h4 id="无序列表"><a href="#无序列表" class="headerlink" title="无序列表"></a>无序列表</h4><ul>
<li>使用标签：<code>&lt;ul&gt;、&lt;li&gt;</code></li>
<li>属性：disc、circle、square(写在ul中)</li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;ul type&#x3D;&quot;square&quot;&gt;</span><br><span class="line">	&lt;li&gt;iOS&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;android&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;html5&lt;&#x2F;li&gt;</span><br><span class="line">&lt;&#x2F;ul&gt;</span><br></pre></td></tr></table></figure>
<h4 id="有序列表"><a href="#有序列表" class="headerlink" title="有序列表"></a>有序列表</h4><ul>
<li>使用标签：<code>&lt;ol&gt;、&lt;li&gt;</code></li>
<li>属性：A、a、I、i、start</li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;ol type&#x3D;&quot;A&quot;&gt;</span><br><span class="line">	&lt;li&gt;iOS&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;android&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;html5&lt;&#x2F;li&gt;</span><br><span class="line">&lt;&#x2F;ol&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;ol start&#x3D;&quot;10&quot;&gt;</span><br><span class="line">	&lt;li&gt;iOS&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;android&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;li&gt;html5&lt;&#x2F;li&gt;</span><br><span class="line">&lt;&#x2F;ol&gt;</span><br></pre></td></tr></table></figure>
<p>start表示从多少开始</p>
<h4 id="嵌套列表"><a href="#嵌套列表" class="headerlink" title="嵌套列表"></a>嵌套列表</h4><ul>
<li>使用标签：<code>&lt;ul&gt;、&lt;ol&gt;、&lt;li&gt;</code></li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;ol&gt;</span><br><span class="line">	&lt;li&gt;宠物&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;ul&gt;</span><br><span class="line">			&lt;li&gt;猫&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;li&gt;狗&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;&#x2F;ul&gt;</span><br><span class="line">	&lt;li&gt;人类&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;ul&gt;</span><br><span class="line">			&lt;li&gt;男人&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;li&gt;女人&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;&#x2F;ul&gt;</span><br><span class="line">	&lt;li&gt;植物&lt;&#x2F;li&gt;</span><br><span class="line">&lt;&#x2F;ol&gt;</span><br></pre></td></tr></table></figure>
<h4 id="自定义列表"><a href="#自定义列表" class="headerlink" title="自定义列表"></a>自定义列表</h4><ul>
<li>使用标签：<code>&lt;dl&gt;、&lt;dt&gt;、&lt;dd&gt;</code></li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;dl&gt;</span><br><span class="line">&lt;dt&gt;helloworld&lt;&#x2F;dt&gt;</span><br><span class="line">	&lt;dd&gt;这是html中的helloworld&lt;dd&gt;</span><br><span class="line">&lt;dt&gt;你好&lt;&#x2F;dt&gt;</span><br><span class="line">&lt;dt&gt;holla&lt;&#x2F;dt&gt;</span><br><span class="line">&lt;&#x2F;dt&gt;</span><br></pre></td></tr></table></figure>
<h3 id="HTML块"><a href="#HTML块" class="headerlink" title="HTML块"></a>HTML块</h3><h4 id="HTML块元素"><a href="#HTML块元素" class="headerlink" title="HTML块元素"></a>HTML块元素</h4><ul>
<li>块元素在显示时，通常会以新行开始</li>
<li>如：<code>&lt;h1&gt;、&lt;p&gt;、&lt;ul&gt;</code></li>
</ul>
<h4 id="HTML内联元素"><a href="#HTML内联元素" class="headerlink" title="HTML内联元素"></a>HTML内联元素</h4><ul>
<li>内联元素通常不会以新行开始</li>
<li>如：<code>&lt;b&gt;、&lt;a&gt;、&lt;img&gt;</code></li>
</ul>
<h4 id="HTML-lt-div-gt-元素"><a href="#HTML-lt-div-gt-元素" class="headerlink" title="HTML&lt;div&gt;元素"></a>HTML<code>&lt;div&gt;</code>元素</h4><ul>
<li><code>&lt;div&gt;</code>元素也被称为块元素，主要是组合HTML元素的容器</li>
</ul>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;123&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">p</span>&gt;</span>hello world<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">a</span>&gt;</span>点击我<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-id">#123</span> <span class="selector-tag">p</span>&#123;</span><br><span class="line">	<span class="attribute">color</span>:red;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">//只有<span class="selector-tag">p</span>标签变化，因为<span class="selector-id">#123</span> 后面写了<span class="selector-tag">p</span></span><br></pre></td></tr></table></figure>
<p>需要引入css</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;lingk rel&#x3D;&quot;stylesheet&quot; type&#x3D;&quot;text&#x2F;css&quot; href&#x3D;&quot;mycss.css&quot;&gt;</span><br></pre></td></tr></table></figure>
<h4 id="HTML-lt-span-gt-元素"><a href="#HTML-lt-span-gt-元素" class="headerlink" title="HTML&lt;span&gt;元素"></a>HTML<code>&lt;span&gt;</code>元素</h4><ul>
<li><code>&lt;span&gt;</code>元素是内联元素，可作为文本的容器</li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;div&gt;</span><br><span class="line">	&lt;p&gt;&lt;span&gt;这是一个测试效果&lt;&#x2F;span&gt;是什么样子&lt;&#x2F;p&gt;</span><br><span class="line">&lt;&#x2F;div&gt;</span><br></pre></td></tr></table></figure>
<p>只改变span的效果，并且需要引入css</p>
<h3 id="HTML布局"><a href="#HTML布局" class="headerlink" title="HTML布局"></a>HTML布局</h3><h4 id="使用-lt-div-gt-元素布局"><a href="#使用-lt-div-gt-元素布局" class="headerlink" title="使用&lt;div&gt;元素布局"></a>使用<code>&lt;div&gt;</code>元素布局</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head lang&#x3D;&quot;en&quot;&gt;</span><br><span class="line">	&lt;meta charset&#x3D;&quot;UTF-8&quot;&gt;</span><br><span class="line">	&lt;title&gt;div布局&lt;&#x2F;title&gt;</span><br><span class="line">	&lt;style type&#x3D;&quot;text&#x2F;css&quot;&gt;</span><br><span class="line">		body&#123;</span><br><span class="line">			margin:0px;</span><br><span class="line">		&#125;</span><br><span class="line">		#container&#123;</span><br><span class="line">			width:100%;</span><br><span class="line">			height:950px;</span><br><span class="line">			background-color:gray;</span><br><span class="line">		&#125;</span><br><span class="line">		#heading&#123;</span><br><span class="line">			width:100%;</span><br><span class="line">			height:10%;</span><br><span class="line">			background-color:red;</span><br><span class="line">			float:left;		</span><br><span class="line">		&#125;</span><br><span class="line">		#content_menu&#123;</span><br><span class="line">			width:30%;</span><br><span class="line">			height:80%;</span><br><span class="line">			background-color:blue;</span><br><span class="line">			float:left;</span><br><span class="line">		&#125;</span><br><span class="line">		#content_body&#123;</span><br><span class="line">			width:70%;</span><br><span class="line">			height:80%;</span><br><span class="line">			background-color:purple;</span><br><span class="line">			float:left;</span><br><span class="line">		&#125;</span><br><span class="line">		#footing&#123;</span><br><span class="line">			width:100%;</span><br><span class="line">			height:10%;</span><br><span class="line">			background-color:black;</span><br><span class="line">			clear:both;</span><br><span class="line">		&#125;</span><br><span class="line">	&lt;&#x2F;style&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;div id&#x3D;&quot;container&quot;&gt;</span><br><span class="line">		&lt;div id&#x3D;&quot;heading&quot;&gt;头部&lt;&#x2F;div&gt;</span><br><span class="line">		&lt;div id&#x3D;&quot;content_menu&quot;&gt;内容菜单&lt;&#x2F;div&gt;</span><br><span class="line">		&lt;div id&#x3D;&quot;content_body&quot;&gt;内容主体&lt;&#x2F;div&gt;</span><br><span class="line">		&lt;div id&#x3D;&quot;footing&quot;&gt;底部&lt;&#x2F;div&gt;</span><br><span class="line">	&lt;&#x2F;div&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="使用-lt-table-gt-元素布局"><a href="#使用-lt-table-gt-元素布局" class="headerlink" title="使用&lt;table&gt;元素布局"></a>使用<code>&lt;table&gt;</code>元素布局</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head lang&#x3D;&quot;en&quot;&gt;</span><br><span class="line">	&lt;mata charset&#x3D;&quot;UTF-8&quot;&gt;</span><br><span class="line">	&lt;title&gt;table布局&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body marginheight&#x3D;&quot;0px&quot; marginwidth&#x3D;&quot;0px&quot;&gt;</span><br><span class="line">&lt;table width&#x3D;&quot;100%&quot; height&#x3D;&quot;950px&quot; style&#x3D;&quot;background:darkgrey&quot;&gt;</span><br><span class="line">	&lt;tr&gt;</span><br><span class="line">		&lt;td colspan&#x3D;&quot;2&quot; width&#x3D;&quot;100%&quot; height&#x3D;&quot;10%&quot; style&#x3D;&quot;background-color&#x3D;black&quot;&gt;头部</span><br><span class="line">		&lt;&#x2F;td&gt;</span><br><span class="line">	&lt;&#x2F;tr&gt;</span><br><span class="line">	&lt;tr&gt;</span><br><span class="line">		&lt;td width&#x3D;&quot;30%&quot; height&#x3D;&quot;80%&quot; style&#x3D;&quot;background-color&#x3D;red&quot;&gt;左菜单&lt;&#x2F;td&gt;</span><br><span class="line">		&lt;td width&#x3D;&quot;70%&quot; height&#x3D;&quot;80%&quot; style&#x3D;&quot;bakcground-color&#x3D;red&quot;&gt;右菜单&lt;&#x2F;td&gt;</span><br><span class="line">	&lt;tr&gt;</span><br><span class="line">		&lt;td colspan&#x3D;&quot;2&quot; width&#x3D;&quot;100%&quot; height&#x3D;&quot;10%&quot; style&#x3D;&quot;bakcground-color&#x3D;gray&quot;&gt;底部</span><br><span class="line">	&lt;&#x2F;tr&gt;</span><br><span class="line">&lt;&#x2F;table&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;</span><br></pre></td></tr></table></figure>

<h3 id="HTML表单"><a href="#HTML表单" class="headerlink" title="HTML表单"></a>HTML表单</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;form&gt;      表单</span><br><span class="line">&lt;input&gt;     输入域</span><br><span class="line">&lt;textarea&gt;  文本域</span><br><span class="line">&lt;label&gt;     控制标签</span><br><span class="line">&lt;fieldset&gt;  定义域</span><br><span class="line">&lt;legend&gt;    域的标题</span><br><span class="line">&lt;select&gt;    选择列表</span><br><span class="line">&lt;optgroup&gt;  选组组</span><br><span class="line">&lt;option&gt;    下拉列表中的选项</span><br><span class="line">&lt;button&gt;    按钮</span><br></pre></td></tr></table></figure>

<body>
    <form>
        用户名：
        <input type="text">
        密码
        <input type="password">
    </form>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">code:</span><br><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		用户名：</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot;&gt;</span><br><span class="line">		密码</span><br><span class="line">		&lt;input type&#x3D;&quot;password&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h4 id="复选框-checkbox"><a href="#复选框-checkbox" class="headerlink" title="复选框(checkbox)"></a>复选框(checkbox)</h4><body>
    <form>
    <p>你喜欢的语言有？</p>
    C++<input type="checkbox">
    JAVA<input type="checkbox">
    Python<input type="checkbox">
    </form>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">	&lt;p&gt;你喜欢的语言有？&lt;&#x2F;p&gt;</span><br><span class="line">	C++&lt;input type&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">	JAVA&lt;input type&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">	Python&lt;input type&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>

<h4 id="单选按钮-radio"><a href="#单选按钮-radio" class="headerlink" title="单选按钮(radio)"></a>单选按钮(radio)</h4><body>
    <form>
    请选择你的性别：
    男<input type="radio" name="sex">
    女<input type="radio" name="sex">
    </form>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">	请选择你的性别：</span><br><span class="line">	男&lt;input type&#x3D;&quot;radio&quot; name&#x3D;&quot;sex&quot;&gt;</span><br><span class="line">	女&lt;input type&#x3D;&quot;radio&quot; name&#x3D;&quot;sex&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>name就是一个组的概念，只有在同一个组才能实现单选</p>
<h4 id="下拉列表-select"><a href="#下拉列表-select" class="headerlink" title="下拉列表(select)"></a>下拉列表(select)</h4><body>
<select>
    <option>iPhone 12 mini</option>
    <option>iPhone 12</option>
    <option>iPhone 12 Pro</option>
    <option>iPhone 12 ProMax</option>
</select>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">&lt;select&gt;</span><br><span class="line">	购买iPhone：</span><br><span class="line">	&lt;option&gt;iPhone 12 mini&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option&gt;iPhone 12&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option&gt;iPhone 12 Pro&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option&gt;iPhone 12 ProMax&lt;&#x2F;option&gt;</span><br><span class="line">&lt;&#x2F;select&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>

<h4 id="文本域-textarea"><a href="#文本域-textarea" class="headerlink" title="文本域(textarea)"></a>文本域(textarea)</h4><p><textarea cols="30" row="30">请在这里填写个人信息</textarea></p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;textarea cols&#x3D;&quot;30&quot; row&#x3D;&quot;30&quot;&gt;请在这里填写个人信息&lt;&#x2F;textarea&gt;</span><br></pre></td></tr></table></figure>
<h4 id="按钮-botton"><a href="#按钮-botton" class="headerlink" title="按钮(botton)"></a>按钮(botton)</h4><form>
<input type="button" value="按钮">
<input type="submit" value="提交">
</form>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;form&gt;</span><br><span class="line">&lt;input type&#x3D;&quot;button&quot; value&#x3D;&quot;按钮&quot;&gt;</span><br><span class="line">&lt;input type&#x3D;&quot;submit&quot; value&#x3D;&quot;提交&quot;&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>
<h4 id="PHP和表单的交互"><a href="#PHP和表单的交互" class="headerlink" title="PHP和表单的交互"></a>PHP和表单的交互</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head lang&#x3D;&quot;en&quot;&gt;</span><br><span class="line">	&lt;meta charset&#x3D;&quot;UTF-8&quot;&gt;</span><br><span class="line">	&lt;title&gt;表单与PHP交互&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form action&#x3D;&quot;PHP的地址&quot; method&#x3D;&quot;post&quot;&gt;</span><br><span class="line">		用户名:&lt;input type&#x3D;&quot;text&quot; name&#x3D;&quot;name&quot;&gt;</span><br><span class="line">		密 码:&lt;input type&#x3D;&quot;password&quot; name&#x3D;&quot;password&quot;&gt;</span><br><span class="line">		&lt;br&#x2F;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;submit&quot; value&#x3D;&quot;提交&quot;&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;  </span><br></pre></td></tr></table></figure>
<figure class="highlight php"><table><tr><td class="code"><pre><span class="line"><span class="meta">&lt;?php</span></span><br><span class="line"><span class="keyword">echo</span><span class="string">&quot;用户名：&quot;</span>.<span class="variable">$_POST</span>[<span class="string">&#x27;name&#x27;</span>].<span class="string">&quot;&lt;br&gt;密码：&quot;</span>.<span class="variable">$_POST</span>[<span class="string">&#x27;password&#x27;</span>];</span><br></pre></td></tr></table></figure>
<h3 id="HTML5框架"><a href="#HTML5框架" class="headerlink" title="HTML5框架"></a>HTML5框架</h3><h4 id="框架标签frame"><a href="#框架标签frame" class="headerlink" title="框架标签frame"></a>框架标签frame</h4><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head lang&#x3D;&quot;en&quot;&gt;</span><br><span class="line">	&lt;mata charset&#x3D;&quot;UTF-8&quot;&gt;</span><br><span class="line">	&lt;title&gt;&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">&lt;body bgcolor&#x3D;&quot;red&quot;&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line">&lt;&#x2F;html&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head lang&#x3D;&quot;en&quot;&gt;</span><br><span class="line">	&lt;meta charset&#x3D;&quot;UTF-8&quot;&gt;</span><br><span class="line">	&lt;title&gt;框架&lt;&#x2F;title&gt;</span><br><span class="line">&lt;&#x2F;head&gt;</span><br><span class="line">	&lt;a href&#x3D;&quot;http:&#x2F;&#x2F;www.baidu.com&quot; taget&#x3D;&quot;top&quot;&gt;百度一下&lt;&#x2F;a&gt;</span><br><span class="line">	&lt;iframe src&#x3D;&quot;framea.html&quot; frameboder&#x3D;&quot;0&quot; width&#x3D;&quot;400px&quot; height&#x3D;&quot;400px&quot;&gt;</span><br><span class="line">	&lt;&#x2F;iframe&gt;	</span><br><span class="line">&lt;&#x2F;html&gt;</span><br></pre></td></tr></table></figure>
<h3 id="target"><a href="#target" class="headerlink" title="target"></a>target</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">_self    在当前窗口打开链接，默认方式</span><br><span class="line">_black   在新的窗口打开链接</span><br><span class="line">_top     在顶层框架中打开链接</span><br><span class="line">_parent  在当前框架的上一层打开链接</span><br></pre></td></tr></table></figure>
<h3 id="HTML背景"><a href="#HTML背景" class="headerlink" title="HTML背景"></a>HTML背景</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body bgcolor&#x3D;&quot;red&quot;&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body background&#x3D;&quot;xxx.jpg&quot;&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<ul>
<li>背景标签：Background</li>
<li>背景颜色：BGcolor</li>
</ul>
<h3 id="HTML的实体"><a href="#HTML的实体" class="headerlink" title="HTML的实体"></a>HTML的实体</h3><p>用来表示特殊字符，需要的时候百度</p>
<h3 id="XHTML"><a href="#XHTML" class="headerlink" title="XHTML"></a>XHTML</h3><ul>
<li>XHTML元素必须正确嵌套</li>
<li>XHTML元素必须始终关闭</li>
<li>XHTML元素必须小写</li>
<li>XHTML文档必须有一个根元素</li>
<li>XHTML属性必须小写</li>
<li>XHTML属性值必须用引号包围</li>
<li>XHTML属性最小化也是禁止的</li>
</ul>
<h3 id="contenteditable属性"><a href="#contenteditable属性" class="headerlink" title="contenteditable属性"></a>contenteditable属性</h3><body>
    <h2>可编辑列表</h2>
    <ul contenteditable="true">
        <li>列表1</li>
        <li>列表2</li>
        <li>列表3</li>
    </ul>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;h2&gt;可编辑列表&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;ul contenteditable&#x3D;&quot;true&quot;&gt;</span><br><span class="line">		&lt;li&gt;列表1&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;列表2&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;列表3&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;&#x2F;ul&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="hidden属性"><a href="#hidden属性" class="headerlink" title="hidden属性"></a>hidden属性</h3><body>
    <h2>可编辑列表</h2>
    <ul hidden="true">
        <li>列表1</li>
        <li>列表2</li>
        <li>列表3</li>
    </ul>
</body>

<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;h2&gt;可编辑列表&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;ul hidden&#x3D;&quot;true&quot;&gt;</span><br><span class="line">		&lt;li&gt;列表1&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;列表2&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;li&gt;列表3&lt;&#x2F;li&gt;</span><br><span class="line">	&lt;&#x2F;ul&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>hidden属性是bool类型，true的时候会通过属性隐藏</p>
<h3 id="spellcheck属性"><a href="#spellcheck属性" class="headerlink" title="spellcheck属性"></a>spellcheck属性</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">&lt;iput type&#x3D;&quot;text&quot; spellcheck&#x3D;&quot;true&quot;&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>spellcheck是拼写检查</p>
<h3 id="tabindex属性"><a href="#tabindex属性" class="headerlink" title="tabindex属性"></a>tabindex属性</h3><p>通过按tab键来获取焦点</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;a href&#x3D;&quot;#&quot; tabindex&#x3D;&quot;1&quot;&gt;hello&lt;&#x2F;a&gt;</span><br><span class="line">	&lt;a href&#x3D;&quot;#&quot; tabindex&#x3D;&quot;3&quot;&gt;hello&lt;&#x2F;a&gt;</span><br><span class="line">	&lt;a href&#x3D;&quot;#&quot; tabindex&#x3D;&quot;2&quot;&gt;hello&lt;&#x2F;a&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>可以调整为-1来不获取焦点，但是有tabindex属性</p>
<h3 id="article元素"><a href="#article元素" class="headerlink" title="article元素"></a>article元素</h3><p><code>&lt;article&gt;</code>标签用于描述独立的内容部分</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;article&gt;</span><br><span class="line">		&lt;header&gt;</span><br><span class="line">			&lt;h1&gt;这是一个标题&lt;&#x2F;h1&gt;</span><br><span class="line">			&lt;p&gt;hello,你好&lt;&#x2F;p&gt;</span><br><span class="line">		&lt;&#x2F;header&gt;</span><br><span class="line">		&lt;footer&gt;</span><br><span class="line">			&lt;p&gt;这是一个底部&lt;&#x2F;p&gt;</span><br><span class="line">		&lt;&#x2F;footer&gt;</span><br><span class="line">	&lt;&#x2F;article&gt;</span><br><span class="line">&lt;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="section元素"><a href="#section元素" class="headerlink" title="section元素"></a>section元素</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;article&gt;</span><br><span class="line">	&lt;h1&gt;苹果&lt;&#x2F;h1&gt;</span><br><span class="line">	&lt;p&gt;这是一个水果&lt;&#x2F;p&gt;</span><br><span class="line">&lt;section&gt;</span><br><span class="line">	&lt;h2&gt;红富士&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;p&gt;这是一个红苹果&lt;&#x2F;p&gt;</span><br><span class="line">&lt;&#x2F;section&gt;</span><br><span class="line">&lt;section&gt;</span><br><span class="line">	&lt;h2&gt;apple&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;p&gt;这是个科技公司&lt;&#x2F;p&gt;</span><br><span class="line">&lt;&#x2F;section&gt;</span><br><span class="line">&lt;&#x2F;article&gt;</span><br></pre></td></tr></table></figure>
<ul>
<li>不要将section作为设置样式的界面容器（那是div的工作）</li>
<li>article是特殊的section</li>
<li>section一般需要标题</li>
</ul>
<h3 id="nav元素"><a href="#nav元素" class="headerlink" title="nav元素"></a>nav元素</h3><p>nav元素是一个可以用作页面导航的连接组，其中的导航元素连接到其他页面或当前页面的其他部分</p>
<p>nav元素的应用场景</p>
<ul>
<li>传统导航条</li>
<li>侧边栏导航</li>
<li>页内导航</li>
<li>翻页操作</li>
</ul>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;nav&gt;</span><br><span class="line">		&lt;ul&gt;</span><br><span class="line">			&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;主页&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;开发文档&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;&#x2F;ul&gt;</span><br><span class="line">	&lt;&#x2F;nav&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="aside元素"><a href="#aside元素" class="headerlink" title="aside元素"></a>aside元素</h3><p>aside元素用来表示当前页面或文章的附属信息部分，他可以包括与当前页面或主要内容相关的引用</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">&lt;header&gt;</span><br><span class="line">	&lt;h1&gt;js&lt;h1&gt;</span><br><span class="line">&lt;&#x2F;header&gt;</span><br><span class="line">&lt;article&gt;</span><br><span class="line">	&lt;h1&gt;语法&lt;&#x2F;h1&gt;</span><br><span class="line">	&lt;p&gt;文章的正文部分&lt;&#x2F;p&gt;</span><br><span class="line">	&lt;aside&gt;</span><br><span class="line">		&lt;h1&gt;名词解释&lt;&#x2F;h1&gt;</span><br><span class="line">		&lt;p&gt;语法：就是js中很重要的一部分&lt;&#x2F;p&gt;</span><br><span class="line">	&lt;&#x2F;aside&gt;</span><br><span class="line">&lt;&#x2F;article&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="time元素和微格式"><a href="#time元素和微格式" class="headerlink" title="time元素和微格式"></a>time元素和微格式</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;time datetime&#x3D;&quot;2020-11-11&quot;&gt;2020-11-11&lt;&#x2F;time&gt;</span><br><span class="line">	&lt;time datetime&#x3D;&quot;2020-11-11T20:00&quot;&gt;2020-11-11&lt;&#x2F;time&gt;   T表示分隔符</span><br><span class="line">	&lt;time datetime&#x3D;&quot;2020-11-11T20:00z&quot;&gt;2020-11-11&lt;&#x2F;time&gt;  z表示标准时间</span><br><span class="line">	&lt;time datetime&#x3D;&quot;2020-11-11T20:00+9:00&quot;&gt;2020-11-11&lt;&#x2F;time&gt; 表示时差</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>微格式实际就是为现有的(X)HTML元素添加元数据和其他属性，增强语义</p>
<h3 id="pubdate属性"><a href="#pubdate属性" class="headerlink" title="pubdate属性"></a>pubdate属性</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;article&gt;</span><br><span class="line">		&lt;header&gt;</span><br><span class="line">			&lt;h1&gt;苹果&lt;&#x2F;h1&gt;</span><br><span class="line">			&lt;time datetime&#x3D;&quot;2020-11-11&quot; pubdate&#x3D;&quot;true&quot;&gt;2020-11-11&lt;&#x2F;time&gt;</span><br><span class="line">		&lt;&#x2F;header&gt;</span><br><span class="line">	&lt;&#x2F;article&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<p>确定一个发布日期的作用</p>
<h3 id="header元素"><a href="#header元素" class="headerlink" title="header元素"></a>header元素</h3><p>header元素是一种具有引导和导航作用的结构元素，通常用来的放置整个页面或页面内的一个内容区块的标题，但是也可以包含其他内容</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;header&gt;</span><br><span class="line">		&lt;h1&gt;页面标题&lt;&#x2F;h1&gt;</span><br><span class="line">	&lt;&#x2F;header&gt;</span><br><span class="line">	&lt;article&gt;</span><br><span class="line">		&lt;header&gt;</span><br><span class="line">		&lt;h1&gt;Hello&lt;&#x2F;h1&gt;</span><br><span class="line">		&lt;&#x2F;header&gt;</span><br><span class="line">	&lt;&#x2F;article&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="footer元素"><a href="#footer元素" class="headerlink" title="footer元素"></a>footer元素</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;footer&gt;</span><br><span class="line">		&lt;ul&gt;</span><br><span class="line">			&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;版权信息&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;站点地图&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;联系方式&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">		&lt;&#x2F;ul&gt;</span><br><span class="line">	&lt;&#x2F;footer&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="hgroup元素"><a href="#hgroup元素" class="headerlink" title="hgroup元素"></a>hgroup元素</h3><p>hgroup元素是将标题及其子标题进行分组的元素。hgroup元素经常会将h1～h6元素进行分组，譬如一个内容区块的标题及其子元素算一组</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;hgroup&gt;</span><br><span class="line">		&lt;h1&gt;这是文章标题&lt;&#x2F;h1&gt;</span><br><span class="line">		&lt;h2&gt;这是文章的子标题&lt;&#x2F;h2&gt;</span><br><span class="line">	&lt;&#x2F;hgroup&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="address元素"><a href="#address元素" class="headerlink" title="address元素"></a>address元素</h3><p>address元素用来在文档中呈现联系信息，包括文档作者的名字，他们的网站链接、电子邮箱、真实地址、电话号码等。</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;address&gt;</span><br><span class="line">	&lt;a href&#x3D;&quot;#&quot;&gt;Lawted&lt;&#x2F;a&gt;</span><br><span class="line">	&lt;time datetime&#x3D;&quot;2020-11-11&quot;&gt;2020-11-11&lt;&#x2F;time&gt;</span><br><span class="line">&lt;&#x2F;address&gt;</span><br></pre></td></tr></table></figure>
<h3 id="网页编排规则"><a href="#网页编排规则" class="headerlink" title="网页编排规则"></a>网页编排规则</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;header&gt;</span><br><span class="line">		&lt;h1&gt;网页标题&lt;&#x2F;h1&gt;</span><br><span class="line">		&lt;nav&gt;</span><br><span class="line">			&lt;ul&gt;</span><br><span class="line">				&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;首页&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">				&lt;li&gt;&lt;a href&#x3D;&quot;#&quot;&gt;帮助&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;</span><br><span class="line">			&lt;&#x2F;ul&gt;</span><br><span class="line">		&lt;&#x2F;nav&gt;</span><br><span class="line">	&lt;&#x2F;header&gt;</span><br><span class="line">	&lt;article&gt;</span><br><span class="line">		&lt;hgroup&gt;</span><br><span class="line">			&lt;h1&gt;文章主标题&lt;&#x2F;h1&gt;</span><br><span class="line">			&lt;h2&gt;文章子标题&lt;&#x2F;h2&gt;</span><br><span class="line">		&lt;&#x2F;hgroup&gt;</span><br><span class="line">		&lt;p&gt;文章正文&lt;&#x2F;p&gt;</span><br><span class="line">	&lt;section&gt;</span><br><span class="line">		&lt;div&gt;</span><br><span class="line">			&lt;article&gt;		</span><br><span class="line">				&lt;h1&gt;评论标题&lt;&#x2F;h1&gt;</span><br><span class="line">				&lt;p&gt;评论正文&lt;&#x2F;p&gt;</span><br><span class="line">			&lt;&#x2F;article&gt;</span><br><span class="line">		&lt;&#x2F;div&gt;</span><br><span class="line">	&lt;&#x2F;section&gt;</span><br><span class="line">	&lt;&#x2F;article&gt;</span><br><span class="line">	&lt;footer&gt;</span><br><span class="line">		&lt;small&gt;版权所有：&lt;&#x2F;small&gt;</span><br><span class="line">	&lt;&#x2F;footer&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的form属性"><a href="#表单内元素的form属性" class="headerlink" title="表单内元素的form属性"></a>表单内元素的form属性</h3><p>HTML5中，可以吧内部从属元素写在页面的任何地方，然后为该元素指定一个form属性，属性值为该表单的id，这样就可以声明该元素从属的指定表单了</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form id&#x3D;&quot;testform&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">	&lt;textarea form&#x3D;&quot;testform&quot;&gt;&lt;&#x2F;textarea&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的formaction属性"><a href="#表单内元素的formaction属性" class="headerlink" title="表单内元素的formaction属性"></a>表单内元素的formaction属性</h3><p>HTML5中可以为所有的提交按钮，增加不同的formaction属性，使单击不同的按钮时可以将表单提交到不同的页面</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;form id&#x3D;&quot;1&quot;&gt;</span><br><span class="line">	&lt;input type&#x3D;&quot;submit&quot; name&#x3D;&quot;s1&quot; value&#x3D;&quot;v1&quot; foraction&#x3D;&quot;xx.jsp&quot;&gt;提交到xxx</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的formmethod属性"><a href="#表单内元素的formmethod属性" class="headerlink" title="表单内元素的formmethod属性"></a>表单内元素的formmethod属性</h3><p>HTML5中，可以使用formmethod属性来对每一个表单元素分别指定不同的提交方式</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form id&#x3D;&quot;testform&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;submit&quot; name&#x3D;&quot;s1&quot; formmethod&#x3D;&quot;post&quot;&gt;提交</span><br><span class="line">		&lt;input type&#x3D;&quot;submit&quot; name&#x3D;&quot;s2&quot; formmethod&#x3D;&quot;get&quot;&gt;提交</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的formenctype属性"><a href="#表单内元素的formenctype属性" class="headerlink" title="表单内元素的formenctype属性"></a>表单内元素的formenctype属性</h3><p>在HTML5中，可以使用formenctype属性对表单元素分别指定不同的编码方式</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formenctype&#x3D;&quot;text&#x2F;plain&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formenctype&#x3D;&quot;multipart&#x2F;form-data&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formenctype&#x3D;&quot;application&#x2F;x-www-form-urlencoded&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的formtarget属性"><a href="#表单内元素的formtarget属性" class="headerlink" title="表单内元素的formtarget属性"></a>表单内元素的formtarget属性</h3><p>在HTML5中，可以对多个提交按钮分别使用formtarget属性来指定提交后在何处打开所需的页面</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formtarget&#x3D;&quot;_blank&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formtarget&#x3D;&quot;_self&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formtarget&#x3D;&quot;_parent&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formtarget&#x3D;&quot;_top&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; formtarget&#x3D;&quot;framename&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="autofocus"><a href="#autofocus" class="headerlink" title="autofocus"></a>autofocus</h3><p>为文本框、选择框或者按钮控件加上autofocus属性，当画面打开时，该空间自动获得光标焦点</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot;&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; autofocus&gt;   第二个会有光标焦点</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的required属性"><a href="#表单内元素的required属性" class="headerlink" title="表单内元素的required属性"></a>表单内元素的required属性</h3><p>HTML5中新增的required属性可以应用在大多数输入元素上，在提交时，如果元素为空白则不允许提交，同时显示提示文字</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		&lt;input type&#x3D;&quot;text&quot; required&#x3D;&quot;required&quot;&gt;</span><br><span class="line">		&lt;botton type&#x3D;&quot;submit&quot;&gt;提交 &lt;&#x2F;botton&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="表单内元素的labels属性"><a href="#表单内元素的labels属性" class="headerlink" title="表单内元素的labels属性"></a>表单内元素的labels属性</h3><p>在HTML5中，为所有可使用标签的表单元素、button、select元素等，定义一个labels属性，属性值为一个NodeList对象，代表该元素所绑定的标签元素所构成的集合</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form id&#x3D;&quot;testform&quot;&gt;</span><br><span class="line">		&lt;label id&#x3D;&quot;label&quot; for&#x3D;&quot;txt_name&quot;&gt;姓名：&lt;&#x2F;label&gt;</span><br><span class="line">		&lt;input id&#x3D;&quot;&quot;&gt;</span><br><span class="line">		等学了js再来补充		</span><br></pre></td></tr></table></figure>
<h3 id="标签的control属性"><a href="#标签的control属性" class="headerlink" title="标签的control属性"></a>标签的control属性</h3><p>HTML5中，可以在标签内部防止一个表单元素，并且通过该标签的control属性来访问该表单元素</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">		&lt;label id&#x3D;&quot;label&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
<h3 id="文本框的placeholder属性"><a href="#文本框的placeholder属性" class="headerlink" title="文本框的placeholder属性"></a>文本框的placeholder属性</h3><p>placeholder是指文本框处于未输入状态的时候显示的输入提示</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;input type&#x3D;&quot;text&quot; placeholder&#x3D;&quot;请输入用户名&quot;&gt;</span><br></pre></td></tr></table></figure>
<h3 id="文本框的list属性"><a href="#文本框的list属性" class="headerlink" title="文本框的list属性"></a>文本框的list属性</h3><p>在HTML5中，为单行文本框增加了一个list属性，该属性的值为某个datalist元素的id。】该元素类似于选择框，但是当用户香要设定的值不在选择列表之内时，允许自行输入。datalist元素本身并不显示，而是当文本框获得焦点时以提示输入的方式显示。</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;form&gt;</span><br><span class="line">	&lt;input type&#x3D;&quot;text&quot; list&#x3D;&quot;greetings&quot;&gt;</span><br><span class="line">	&lt;datalist id&#x3D;&quot;greetings&quot; &gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;HTML5&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;CSS&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;ios&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;&#x2F;datalist&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>
<h3 id="文本框的autocomplete属性"><a href="#文本框的autocomplete属性" class="headerlink" title="文本框的autocomplete属性"></a>文本框的autocomplete属性</h3><p>帮助输入自动完成的功能</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;form&gt;</span><br><span class="line">	&lt;input type&#x3D;&quot;text&quot; autocomplete&#x3D;&quot;on&quot; list&#x3D;&quot;greetings&quot;&gt;</span><br><span class="line">	&lt;datalist id&#x3D;&quot;greetings&quot; &gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;HTML5&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;CSS&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;option value&#x3D;&quot;ios&quot;&gt;&lt;&#x2F;option&gt;</span><br><span class="line">	&lt;&#x2F;datalist&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>
<h3 id="文本框的pattern属性"><a href="#文本框的pattern属性" class="headerlink" title="文本框的pattern属性"></a>文本框的pattern属性</h3><p>在HTML5中，对input元素使用pattern属性，并且将属性值设为某个格式的正则表达式，在提交时会针对这些进行检查，检查其内容是否符合给定的格式。</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;input pattern&#x3D;&quot;[A-Z]&#123;3&#125;&quot; name&#x3D;&quot;part&quot;&gt;</span><br><span class="line">&lt;input type&#x3D;&quot;submit&quot;&gt;</span><br></pre></td></tr></table></figure>
<h3 id="文本框的SelectionDirection属性"><a href="#文本框的SelectionDirection属性" class="headerlink" title="文本框的SelectionDirection属性"></a>文本框的SelectionDirection属性</h3><p>用户在input和textarea元素中用鼠标选取部分文字时，可以使用该属性来获取选取的方向，forward和backward</p>
<h3 id="复选框的indeterminate属性"><a href="#复选框的indeterminate属性" class="headerlink" title="复选框的indeterminate属性"></a>复选框的indeterminate属性</h3><p>￼可以在js脚本代码中对该元素使用indeterminate属性，以说明复选框处于尚未明确是否选取的状态</p>
<h3 id="image提交按钮的height属性和width属性"><a href="#image提交按钮的height属性和width属性" class="headerlink" title="image提交按钮的height属性和width属性"></a>image提交按钮的height属性和width属性</h3><figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">	&lt;form&gt;</span><br><span class="line">	&lt;input type&#x3D;&quot;image&quot; src&#x3D;&quot;....&quot;  width&#x3D;&quot;50&quot; height&#x3D;&quot;50&quot;&gt;</span><br><span class="line">	&lt;&#x2F;form&gt;</span><br><span class="line">&lt;&#x2F;body&gt;</span><br></pre></td></tr></table></figure>
    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E6%8A%80%E6%9C%AF/" rel="tag"># 技术</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2021/01/26/%E9%9A%8F%E7%AC%94/%E6%AC%A2%E8%BF%8E%E6%9D%A5%E5%88%B0lawted%E7%9A%84%E5%8D%9A%E5%AE%A2/" rel="prev" title="欢迎来到lawted的博客">
                  <i class="fa fa-chevron-left"></i> 欢迎来到lawted的博客
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2021/01/28/JavaScript/JavaScript/" rel="next" title="JavaScript基础">
                  JavaScript基础 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Lawted Wu</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>

    </div>
  </footer>

  


  <script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>


<script>
var options = {
  bottom: '64px', // default: '32px'
  right: '32px', // default: '32px'
  left: 'unset', // default: 'unset'
  time: '0.5s', // default: '0.3s'
  mixColor: '#fff', // default: '#fff'
  backgroundColor: '#fff',  // default: '#fff'
  buttonColorDark: '#000',  // default: '#100f2c'
  buttonColorLight: '#fff', // default: '#fff'
  saveInCookies: true, // default: true,
  label: ' ', // default: ''
  autoMatchOsTheme: true // default: true
}
const darkmode = new Darkmode(options);
darkmode.showWidget();
</script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  






  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





</body>
</html>
